REQUIRED_TOOLCHAINS = ['codesourcery']

def options(opt):
    opt.load('hilscher_netx hilscher_firmware hilscher_extras', tooldir='Waf')
    opt.autorecurse(mandatory=False, excl=['build', 'dist'])

def configure(conf):
    conf.autorecurse(mandatory = False)
    conf.load('hilscher_netx hilscher_firmware hilscher_extras', tooldir='Waf')
    
def build(bld):
    defines = ['CIFX_TOOLKIT_HWIF',
              ]
              
    sources   = [
                  'Source/*.c',
                  'Source/cifXDev/*.c',
                  'OSAbstraction/*.c',
                  'SerialDPM/*.c',
                ]         
    #sources = bld.path.ant_glob('**/*.c'),                
              
    bld.stlib(
      target    = 'nonos-test.a',
      toolchain = 'codesourcery',
      platform  = 'netx',
      defines   = defines,
      includes  = [
                    'OSAbstraction',
                    'Source',
                    'Source/cifXDev',
                    'Source/Common/CifXAPI',
                    'Source/Common/HilscherDefinitions',
                    'SerialDPM',
                  ],
      source = bld.path.ant_glob(sources),
    )
